package com.invengo.module_robot.data.api;

import com.invengo.base.http.RobotBaseBean;
import com.invengo.library_db.entity.module_robot.ActivitBean;
import com.invengo.library_db.entity.module_robot.RobotTokenBean;
import com.invengo.module_robot.data.entity.DouBanBeans;
import com.invengo.module_robot.data.entity.PopularBean;
import com.invengo.module_robot.data.entity.SearchBean;

import java.util.HashMap;
import java.util.List;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseBean;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface RobotApi {

    @GET("/api/services/app/BookInfos/GetDoubanBookByIsbns")
    Observable<RobotBaseBean<List<DouBanBeans>>> getImages(@Query("isbns") List<String> isbn);
    @GET("/api/services/app/ItemEntities/GetAllOPAC")
    Observable<RobotBaseBean<SearchBean>> searchBook(@Query(value = "FuzzySearchCondition",encoded = true) String keyworkd);

    @GET("/api/services/app/ItemEntities/GetAllOPAC")
    Observable<RobotBaseBean<SearchBean>> getBookInfoByIsbn(@Query(value = "ISBN") String isbn);

    @GET("/api/services/app/CirculateStat/GetPopularBookAsync?isReturnDetail=true")
    Observable<RobotBaseBean<List<PopularBean>>> getPopularBook();

    @POST("/api/TokenAuth/Authenticate")
//    @Headers({"Abp.TenantId:7795"})
    Observable<RobotBaseBean<RobotTokenBean>> login(@Header ("Abp.TenantId")String tenantId,@Body RequestBody body);

    @GET("/api/services/app/Activities/GetAll")
    Observable<RobotBaseBean<ActivitBean>> getActivities();

    @GET("api/services/app/Attachments/GetStreamAsync")
    Observable<ResponseBody> getActivityImage(@Query("attachmentId")String attachmentId);
}
